﻿using System;

namespace Program08
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("1-4的和为：" + GetSum(4));
        }
        public static int GetSum (int n)
            {
                if (n == 1)                
                    return 1;

                //递归调用自己
                int tmp = GetSum(n - 1);
                return tmp + n;              
            }


    }

    
}
